package com.company.cloud.product.modules.api.service;

import java.util.Map;
import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.product.modules.api.fallback.ProductStoctRemoteServiceFallbackFactory;
import com.company.cloud.product.modules.api.request.ProductStockMultipleSkuOpParam;
import com.company.cloud.product.modules.api.request.ProductStockSingleSkuOpParam;
import com.company.cloud.product.modules.api.response.PrdSkuStock;
import com.company.common.server.constant.ServiceNameConstant;

/**
 * 
 * */
@FeignClient(contextId = "prd2", name = ServiceNameConstant.prd_center, fallbackFactory = ProductStoctRemoteServiceFallbackFactory.class)
public interface ProductStoctRemoteService {

	@RequestMapping(value = "/remote/prdStock/opSingleSkuStock", method = RequestMethod.POST)
	public BaseClientResult<String> opSingleSkuStock(@RequestBody ProductStockSingleSkuOpParam params);

	@RequestMapping(value = "/remote/prdStock/opMultipleSkuStock", method = RequestMethod.POST)
	public BaseClientResult<String> opMultipleSkuStock(@RequestBody ProductStockMultipleSkuOpParam params);
	
	/**SKU库存*/
	@RequestMapping(value = "/remote/prdStock/getSkuStockList", method = RequestMethod.POST)
	public BaseClientResult<Map<String, PrdSkuStock>> getSkuStockList(@RequestBody Set<String> skuNos);
	
	/**PRD库存*/
	@RequestMapping(value = "/remote/prdStock/getPrdStockList", method = RequestMethod.POST)
	public BaseClientResult<Map<String, PrdSkuStock>> getPrdStockList(@RequestBody Set<String> prdNos);
	
	/**PRD的SKU库存*/
	@RequestMapping(value = "/remote/prdStock/getPrd2SkuStock", method = RequestMethod.GET)
	public BaseClientResult<Map<String, PrdSkuStock>> getPrd2SkuStock(@RequestParam("prdNo")  String prdNo);
	
	

}
